<?php
/* -------------------------------------------------------------------------------------
* 	ID:						$Id: pi_clickandbuy_recurring.php 92 2013-09-21 12:04:43Z phone.mueller@googlemail.com $
* 	Letzter Stand:			$Revision: 92 $
* 	zuletzt geaendert von:	$Author: siekiera $
* 	Datum:					$Date: 2013-09-21 12:04:43 +0000 (Sat, 21 Sep 2013) $
*
* 	SEO:mercari by Siekiera Media
* 	http://www.seo-mercari.de
*
* 	Copyright © since 2011 SEO:mercari
* --------------------------------------------------------------------------------------
* 	based on:
* 	© 2000-2001 The Exchange Project  (earlier name of osCommerce)
* 	© 2002-2003 osCommerce - www.oscommerce.com
* 	© 2003     nextcommerce - www.nextcommerce.org
* 	© 2005     xt:Commerce - www.xt-commerce.com
*
* 	Released under the GNU General Public License
* ----------------------------------------------------------------------------------- */
/**
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License, version 2, as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * @category  PayIntelligent
 * @package   PayIntelligent_ClickandBuy
 * @copyright (C) 2010 PayIntelligent GmbH  <http://www.payintelligent.de/>
 * @license   GPLv2
 */

require('includes/application_top.php');
$language= $_SESSION['language'];

include('../lang/'.$_SESSION['language'].'/admin/pi_clickandbuy.php');		

require(DIR_FS_CATALOG.DIR_WS_CLASSES.'class.clickandbuy.php');
$cab = new clickandbuy();			

$shopOrderID = $_GET['oID'];

$mmsList = array();
$i = 0;

$row = $db->db_query("SELECT * FROM ".DB_PREFIX."picab_transactions WHERE shopOrderID = '".$shopOrderID."' AND transactionType = 'recurring' ORDER BY created ASC ");

while (!$row->EOF) {
	$recurringList[$i] = $row->fields;			
	$i++;
	$row->MoveNext();
}
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
	<tr>
		<td>
			<table border="0" width="100%" cellspacing="0" cellpadding="2" height="40">
				<tr>
					<td class="pageHeading"><?php echo CLICKANDBUY_ORDER_CLICKANDBUY.' '.CLICKANDBUY_ORDER_RECURRING; ?></td>
					<td class="pageHeading" align="right">
						<a class="button cab_button" href="pi_clickandbuy_details.php?oID=<?php echo $shopOrderID; ?>">
							<?php echo CLICKANDBUY_ORDER_DETAILS_BACK; ?>
						</a>
					</td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td>
			<table border="0" width="100%" cellspacing="0" cellpadding="2">
				<tr>
					<td>
						<table cellspacing="0" cellpadding="5" border="0" width="98%">
							<tr>
								<td class="edittext" width="50%">
								<?php if (empty($recurringList)) { ?>
									<p><?php echo CLICKANDBUY_ORDER_NO_ENTRIES; ?></p>
								<?php } else { ?>								
									<table cellspacing="0" cellpadding="5" border="0" width="100%">
										<tr>
											<td width="30" height="15" align="left" class="infoBoxHeading"><b><?php echo CLICKANDBUY_ORDER_DETAILS_TRANSACTIONID; ?></b></td>
											<td class="infoBoxHeading"><b><?php echo CLICKANDBUY_ORDER_DETAILS_EXTERNALID; ?></b></td>
											<td class="infoBoxHeading"><b><?php echo CLICKANDBUY_ORDER_DETAILS_AMOUNT; ?></b></td>
											<td class="infoBoxHeading"><b><?php echo CLICKANDBUY_ORDER_RECURRING_CURRENCY; ?></b></td>
											<td class="infoBoxHeading"><b><?php echo CLICKANDBUY_ORDER_DETAILS_DESCRIPTION; ?></b></td>
											<td class="infoBoxHeading"><b><?php echo CLICKANDBUY_ORDER_DETAILS_STATUS; ?></b></td>
											<td class="infoBoxHeading"><b><?php echo CLICKANDBUY_ORDER_DETAILS_DATE_TIME; ?></b></td>
										</tr>				
										<?php foreach ($recurringList as $item => $value) { ?>
										<tr>
											<td class="infoBoxContent" height="20" align="left"><?php echo $value['transactionID']; ?></td>
											<td class="infoBoxContent">&nbsp;<?php echo $value['externalID']; ?></td>
											<td class="infoBoxContent">&nbsp;<?php echo $value['amount']; ?></td>
											<td class="infoBoxContent">&nbsp;<?php echo $value['currency']; ?></td>
											<td class="infoBoxContent">&nbsp;<?php echo $value['description']; ?></td>
											<td class="infoBoxContent">&nbsp;<?php echo $value['status']; ?></td>
											<td class="infoBoxContent">&nbsp;<?php echo $value['created']; ?></td>
										</tr>
										<?php } ?>
									</table>
									<?php } ?>
								</td>
							</tr>	
						</table>
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>